ARG UBUNTU_VERSION=22.04
FROM ubuntu:${UBUNTU_VERSION} AS base1
ENV webroot=/data/web/work/ appstore=/data/web/store/ nginx_version=nginx-1.26.3
LABEL version=1.1 name=tshhbyc
COPY ./index.html $webroot
WORKDIR ${webroot}
RUN mkdir -p ${appstore}src2/
ADD https://nginx.org/download/${nginx_version}.tar.gz ${appstore}src2
RUN cd ${appstore}src2 && tar zxvf ${nginx_version}.tar.gz
RUN apt-get update -y && apt install -y build-essential libpcre3 libpcre3-dev zlib1g-dev 
RUN cd ${appstore}src2/${nginx_version} && ./configure --prefix=/usr/local/nginx && make && make install
CMD ["/usr/local/nginx/sbin/nginx","-g daemon off;"]
EXPOSE 80/tcp
#ag
VOLUME ["/data"]
RUN echo "Hello bit by Dockerfile volume" > /data/myvolume.txt
#SHELL ["/bin/bash","-xc"]
RUN echo $PATH > /data/bashtext.txt
#HEALTHCHECK --interval=30s --timeout=30s CMD curl -f http://localhost || exit 1
HEALTHCHECK \
  --interval=30s \
  --timeout=30s \
  --start-period=60s \
  --retries=3 \      
  CMD curl -fsS http://127.0.0.1 || exit 1
ONBUILD RUN echo 'hello world' > /data/hello.txt 
STOPSIGNAL 9